package com.datas.controller;

import com.datas.service.UtilService;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by jige0727 on 2016/12/24.
 */
@Controller
public class UtilController {
    @Autowired
    UtilService utilService;

//    @ResponseBody
//    @RequestMapping(value = {"/", "/home"}, produces = "application/json;charset=UTF-8")
//    public String home() {
//        return new JSONObject().put("position", "home").toString();
//    }


    @ResponseBody
    @RequestMapping(value = "/flush/mng-dept", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    public String flushMngDept() {
        JSONObject res = utilService.flushMngDept();
        return res.toString();
    }
}
